subroutine calciabcd(r1, r2, t1, t2, icore, rivv, rivv2)
!use common
use mod_iop
use mod_size
use mod_orbit
use mod_ioff 
real*8, intent(in) :: r1(*), r2(*), t1(*), t2(*), rivv(*), rivv2(*)
!
call effectt2(t2, t1,  icore, 1.d0, no, nv)
!write(6,*)'finished iabcd prepare for gpu 1'
!call r2abij_t2efij_iefab3_ri(r2, t2, rivv, rivv2, icore, 0.5d0)  !rhf finished
 call t2_half(t2, 0.5d0)
!write(6,*)'finished iabcd prepare for gpu 2'
if(ioiabcd==0) then 
    call r2abij_t2efij_iefab2_ri(r2, t2, rivv, rivv2, icore, 0.5d0)  !rhf finished
else
   write(6,*)'error in calciabcd!!!!!'
   stop
endif
 call t2_half(t2, 2.d0)
call effectt2(t2, t1,  icore, -1.d0, no, nv)
!------
return
end
